﻿using System.ComponentModel;
using Infrastructure;
using ToolBar.Interfaces;
using System.Collections.ObjectModel;
using ToolBar.Interfaces.Model;
using Microsoft.Practices.Prism.Commands;
namespace ToolBar.Views
{
    public class DummyToolBarViewModel : BaseViewModel, IToolBarViewModel
    {

        public DelegateCommand<object> MenuSwitchPageCommand {get;set;}

        public DummyToolBarViewModel()
        {
            this.MenuSwitchPageCommand = new DelegateCommand<object>((obj) => { MenuSwitchPage(obj); });
            BuildDummyData();
        }

        private void MenuSwitchPage(object obj)
        {
            var test = obj;
        }

        private void BuildDummyData()
        {
            _menuItems.Add(new MenuItem()
            {
                DisplayName = "Stocks",
                ToolTip = "Stocks",
                Children = new ObservableCollection<MenuItem>()
            {
                new MenuItem() { DisplayName = "NYSE", ToolTip="NYSE", Description = "NYSE" },
                new MenuItem() { DisplayName = "NASDAQ", ToolTip = "NASDAQ", Description = "NASDAQ" }
            }
            });

            _menuItems.Add(new MenuItem() { DisplayName = "About", ToolTip = "About", Description = "About" });
            
        }

        public ObservableCollection<MenuItem> _menuItems = new ObservableCollection<MenuItem>();
        public ObservableCollection<MenuItem> MenuItems
        {
            get { return _menuItems; }
            set { _menuItems = value; FireProperty("MenuItems"); }
        }
    }
}